import request from './request'

// 获取分类列表（知识领域传level=1，学习方向传level=2）
export function getCategoriesList(level = 1, parentId = null) {
  const params = { level }
  if (parentId) {
    params.parentId = parentId
  }
  
  return request({
    url: '/categories/list',
    method: 'get',
    params
  })
}

// 获取分类详情
export function getCategoryDetail(id) {
  return request({
    url: `/categories/${id}`,
    method: 'get'
  })
}
